const http = require('http');
var server = http.createServer();
server.on("request",function(req,res){
    console.log(req.headers);//请求头信息
    console.log(req.rawHeaders);//全部头信息,数组形式
    console.log(req.httpVersion);//请求的协议版本
    console.log(req.method);//请求方式
    console.log(req.url);//请求路径
    res.end();
});

server.listen(8080,function(){
    console.log("服务器已启动，端口号：8080")
});